home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
lang
/
PPCsmalltalk.lha
/
PPCSmallTalk
/
prelude
/
array.st
< prev
next >
Wrap
Text File
|
1986-10-19
|
696b
|
32 lines
Class Array :ArrayedCollection
[
new: aValue
^ <primitive 114 aValue>
|
at: aNumber
( (aNumber < 1) or: [aNumber > <primitive 4 self> ] )
ifTrue: [ self error: 'index error'. ^nil ].
^ <primitive 111 self aNumber >
|
at: aNumber put: aValue
( (aNumber < 1) or: [aNumber > <primitive 4 self> ] )
ifTrue: [ self error: 'index error'. ^nil ].
<primitive 112 self aNumber aValue >.
^ aValue
|
grow: newObject
^ <primitive 113 self newObject>
|
printString | value i |
value <- ')'.
i <- <primitive 4 self>.
[i > 0] whileTrue:
[ value <- <primitive 111 self i> printString ,
' ', value.
i <- i - 1].
^ '#( ' , value
|
size
^ <primitive 4 self>
]